package com.jt;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.CharBuffer;

public class ServerTest1 {

    public static void main(String[] args) throws IOException {
        ServerSocket  ss=new ServerSocket(9999);

        Socket accept = ss.accept();
        InputStream inputStream = accept.getInputStream();

        InputStreamReader  isr=new InputStreamReader(inputStream);

        char  arr[]=new char[1024];
        int length=0;
        while((length=isr.read(arr ))!=-1){
            System.out.println(new String(arr).toString());
        }
    }
}
